<?php

/**
 * Created by JetBrains PhpStorm.
 * User: GMC02
 * Date: 9/25/13
 * Time: 4:46 PM
 * To change this template use File | Settings | File Templates.
 */
class HSUrl {

    // region Common

    public static function home() {
        return Yii::app()->getBaseUrl(true);
    }

    // endregion

    public static function searchUrl() {
        return HSUrl::home() . '/tim-kiem';
    }

    // region User
    public static function login() {
        return CHtml::normalizeUrl(array('user/login'));
    }

    public static function loginOpenID($provider = 'facebook') {
        return CHtml::normalizeUrl(array('user/openid', 'provider' => $provider));
    }

    public static function logout() {
        return CHtml::normalizeUrl(array('user/logout'));
    }

    // endregion

    //region BACK-END

    public static function backendUrl() {
        return Yii::app()->BaseUrl . '/backend.php';
    }

    public static function backendDefaultUrl() {
        return HSUrl::backendUrl() . '/site/index';
    }

    public static function backendChangePasswordUrl() {
        return HSUrl::backendUrl() . '/user/changePassword';
    }

    public static function backendLoginUrl() {
        return HSUrl::backendUrl() . '/user/login';
    }

    public static function backendLogoutUrl() {
        return HSUrl::backendUrl() . '/user/logout';
    }

    public static function backendUsersUrl() {
        return HSUrl::backendUrl() . '/user/index';
    }

    public static function backendCreateUsersUrl() {
        return HSUrl::backendUrl() . '/user/create';
    }

    public static function backendUpdatePasswordUserUrl($id) {
        return HSUrl::backendUrl() . '/user/updatePassword?id=' . $id;
    }

    public static function backendCreateProductUrl() {
        return HSUrl::backendUrl() . '/product/create';
    }

    public static function backendProductUrl() {
        return HSUrl::backendUrl() . '/product/index';
    }

    public static function backendPrintMenuUrl() {
        return HSUrl::backendUrl() . '/product/menu';
    }

    public static function backendPrintAllProduct() {
        return HSUrl::backendUrl() . '/product/printAll';
    }

    public static function backendPrintByDateProduct($date) {
        return HSUrl::backendUrl() . '/product/printByDate?date=' . $date;
    }

    public static function backendPrintCurrentDayProduct() {
        return HSUrl::backendUrl() . '/product/print';
    }

    public static function backendCreateAdsUrl() {
        return HSUrl::backendUrl() . '/advertise/create';
    }

    public static function backendAdsUrl() {
        return HSUrl::backendUrl() . '/advertise/index';
    }

    public static function backendPrintAdsMenuUrl() {
        return HSUrl::backendUrl() . '/advertise/menu';
    }

    public static function backendPrintAllAds() {
        return HSUrl::backendUrl() . '/advertise/printAll';
    }

    public static function backendPrintByDateAds($date) {
        return HSUrl::backendUrl() . '/advertise/printByDate?date=' . $date;
    }

    public static function backendPrintCurrentDayAds() {
        return HSUrl::backendUrl() . '/advertise/print';
    }

    public static function backendCreateCategoryUrl() {
        return HSUrl::backendUrl() . '/category/create';
    }

    public static function backendCategoryUrl() {
        return HSUrl::backendUrl() . '/category/index';
    }

    //endregion
}